"""
@File: emailapi.py
@Project: 约个球
@Author: zhangjian
@Time: 2022.9.4 19:06
@Description: None
"""
# from manage import app
from functools import wraps
from flask import Blueprint, request
from flask_restful import Resource, Api
from libs.amap import geo_response, geo_distance
from libs.response import generate_response
from model import db
from model.schedule import ScheduleManager
from model.user import UserManager
from libs.handler import default_error_handler
import flask_mail

email_bp = Blueprint("emailapi", __name__, url_prefix="/v1")
api = Api(email_bp)
api.handle_error = default_error_handler


class Email(Resource):
    """邮件类"""
    def get(self, schedule_id=None):
        """发送邮件通知"""
        if schedule_id is not None:
            pass


    def post(self):
        pass
        # # 初始化对象
        # mail_obj = flask_mail.Mail(server.htapp)
        # # 定义邮件对象
        # msgobject = flask_mail.Message(
        #     subject="这是一个示例邮件",
        #     body="这是一个示例邮件丫",
        #     sender="dami_zhang@foxmail.com",
        #     recipients=["dami_zhang@foxmail.com"]
        # )
        # send_async_email(msg=msgobject)
        # return ''


api.add_resource(Email, "/email")